<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="css/_default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="mainpage">
<s:form>
	<span class="title">会員管理　>　会員リスト</span>
	<center>
	<p>
		<s:select name="uqUserRank"
			list="#{
				'0':'すべて',
				'1':'ゴールド',
				'2':'シルバー',
				'3':'ブロンズ',
				'4':'脱会'}">
		</s:select>
	    <s:select name="usKensakuKubun" 
			list="#{'userId':'ユーザID'}">
		</s:select>
		<s:textfield name="usKensakuKomoku" cssClass="txtInput"></s:textfield>
		<s:submit action="memberSearch" value="検索" cssClass="btnSearch"></s:submit>
	</p>
	<table class="maincontent">
		<tr><td class="membertdtitle membertdtitle1">ユーザID</td>
		    <td class="membertdtitle membertdtitle2">UID</td>
			<td class="membertdtitle membertdtitle3">ポイント</td>
			<td class="membertdtitle membertdtitle4">入会日</td>
			<td class="membertdtitle membertdtitle5">退会日</td>
			<td class="membertdtitle membertdtitle6">会員ランク</td></tr>
		<s:iterator value="listUser">
		<s:url id="userInfoUrl" action="memberInfo" >
		  <s:param name="uqUserId" value="%{userId}"  />
		</s:url>
		<s:url id="pointInfoUrl" action="memberPoint" >
		  <s:param name="pqUserId" value="%{userId}" />
		</s:url>
		<tr><td class="membertd membertd1"><s:a href="%{userInfoUrl}" ><s:property value="userId" /></s:a></td>
			<td class="membertd membertd2">&nbsp;<s:property value="UID" /></td>
			<td class="membertd membertd3">&nbsp;<s:a href="%{pointInfoUrl}"><s:property value="point" /></s:a>&nbsp;</td>
			<td class="membertd membertd4"><s:property value="nyukaibi" /></td>
			<td class="membertd membertd5">&nbsp;<s:property value="taikaibi" />&nbsp;</td>
			<td class="membertd membertd6"><s:property value="userRankName" /></td>
		</tr>
	    </s:iterator>
	</table>
	<p>
	  <c:if test="${pageMap.prevPage != 0}">
        <c:url var="prevPage" value="memberList.action" scope="request">
          <c:param name="curPage" value="${pageMap.prevPage}" />
          <c:param name="usKensakuKubun" value="${usKensakuKubun}" />
          <c:param name="usKensakuKomoku" value="${usKensakuKomoku}" />         
        </c:url>
        <a href="${prevPage}">≪</a>&nbsp;&nbsp;
      </c:if>
      <c:forEach var="i" begin="${pageMap.startPage}" end="${pageMap.endPage}" step="1">
        <c:url var="pageMove" value="memberList.action" scope="request">
          <c:param name="curPage" value="${i}" />
          <c:param name="usKensakuKubun" value="${usKensakuKubun}" />          
          <c:param name="usKensakuKomoku" value="${usKensakuKomoku}" />
          <c:param name="uqUserRank" value="${uqUserRank}" />
        </c:url>
        <c:choose>
          <c:when test="${i==pageMap.curPage}">
            <a href="${pageMove}"><font color="red">${i}</font></a>
          </c:when>
          <c:otherwise>
            <a href="${pageMove}">${i}</a>
          </c:otherwise>
        </c:choose>
        <c:if test="${i<pageMap.endPage}">|</c:if>
      </c:forEach>
      <c:if test="${pageMap.nextPage != 0}">
        <c:url var="nextPage" value="memberList.action" scope="request">
          <c:param name="curPage" value="${pageMap.nextPage}" />
          <c:param name="usKensakuKubun" value="${usKensakuKubun}" />          
          <c:param name="usKensakuKomoku" value="${usKensakuKomoku}" />
        </c:url>
        &nbsp;&nbsp;<a href="${nextPage}">≫</a>
      </c:if>
    </p>
	</center>
</s:form>
</div>
</body>
</html>